﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Vds2465Telegrams;

namespace Vds2465Parser
{
	[TestClass]
	public class GenParse_UserData_26_BlockStateAll_Test
	{
		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test01_ParseBytesOnly()
		{
			byte[] userDataBytes = new byte[] { 0x0F, UserData.UserData26BlockStateAll, 0x50, 0x60, 0x70, 0x10, 0x03, 0xff, 0xff, 0xff, 0x02, 0x01, 0xff, 0x01, 0x02, 0xff, 0xff };

			int consumedBytes;
			UserData userData26BlockStateAll;
			bool bRetVal = GenParse_UserData_26_BlockStateAll.ParseBytes(userDataBytes, out userData26BlockStateAll, out consumedBytes);
			Assert.IsTrue(bRetVal);
			Assert.IsNotNull(userData26BlockStateAll);
			Assert.IsTrue(consumedBytes > 0);

			UserData_26_BlockStateAll userData26 = new UserData_26_BlockStateAll(0x50, 0x60, 0x70, new byte[] { 0xFF, 0xFF }, new byte[] { 0xFF }, new byte[] { 0xFF, 0xFF, 0xFF });
			Assert.AreEqual(userData26, userData26BlockStateAll);
		}
	}
}
